package com.evon.yardmanagement.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.evon.yardmanagement.dao.CompanyDAO;
import com.evon.yardmanagement.dao.KeyBinDAO;
import com.evon.yardmanagement.dao.KeyBoxDAO;
import com.evon.yardmanagement.dao.MemberDAO;
import com.evon.yardmanagement.dao.ParkingSlotDAO;
import com.evon.yardmanagement.dao.RoleDAO;
import com.evon.yardmanagement.dao.SectionDAO;
import com.evon.yardmanagement.dao.UserDAO;
import com.evon.yardmanagement.dao.YardDAO;

/**
 * Member of the yards
 * @author vgaurav
 *
 */
@Entity
@Table(name="MEMBER")
@AttributeOverride(name = "id", column = @Column(name = "MEMBER_ID"))
public class Member extends BaseModel  implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Column(name="MEMBER_TYPE")
	private String type;
	
	@Column(name="FIRST_NAME")
	private String firstName;
	
	@Column(name="LAST_NAME")
	private String lastName;
	
	@Column(name="MIDDLE_NAME")
	private String middleName;
	
	@Column(name="ADDRESS")
	private String address;
	
	@Column(name="CITY")
	private String city;
	
	@Column(name="PHONE")
	private String phone;
	
	@ManyToOne
	@JoinColumn(name="YARD_ID",referencedColumnName="YARD_ID", insertable=false, updatable=false)
	private Yard yard;
	
	@Column(name = "Yard_Id")
	private int yardId;
	
	@Column(name="OCCUPIED")
	private int occupied;
	
	
	
	public int getOccupied() {
		return occupied;
	}



	public void setOccupied(int occupied) {
		this.occupied = occupied;
	}



	public Yard getYard() {
		return yard;
	}



	public void setYard(Yard yard) {
		this.yard = yard;
	}



	public String getType() {
		return type;
	}



	public void setType(String type) {
		this.type = type;
	}



	public String getFirstName() {
		return firstName;
	}



	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}



	public int getYardId() {
		return yardId;
	}



	public void setYardId(int yardId) {
		this.yardId = yardId;
	}



	public String getLastName() {
		return lastName;
	}



	public String getMiddleName() {
		return middleName;
	}



	public String getAddress() {
		return address;
	}



	public String getCity() {
		return city;
	}



	public String getPhone() {
		return phone;
	}



	public void setLastName(String lastName) {
		this.lastName = lastName;
	}



	public void setMiddleName(String middleName) {
		this.middleName = middleName;
	}



	public void setAddress(String address) {
		this.address = address;
	}



	public void setCity(String city) {
		this.city = city;
	}



	public void setPhone(String phone) {
		this.phone = phone;
	}



	public static void main(String[] ats){
		List<Member> vendors = new MemberDAO().findAll();
		for(Member vendor :vendors){
			System.out.println(vendor.getFirstName());
			
		}
	}

}
